package com.heima;

import java.util.ArrayList;
import java.util.Scanner;

public class Homework02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入QQ号：");
        String q = sc.next();
        System.out.println(QQ(q));
        ArrayList<Integer> list = new ArrayList<>();
        list.add(111);
    }

    public static boolean QQ(String q) {
        if (q.length() < 5 || q.length() > 12) {
            return false;
        }
        for (int i = 0; i < q.length(); i++) {
            if(q.charAt(0)=='0'){
                return false;
            }
            if (q.charAt(0) < '0' || q.charAt(0) > '9') {
                return false;
            }
            if (q.charAt(0) < '0' || q.charAt(0) > '9') {
                return false;
            }
        }
        return true;
    }
}
